package org.example.objects;

import com.google.common.collect.ComparisonChain;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Person implements Comparable<Person>{

    private String firstName;
    private String secondName;



    @Override
    public int compareTo(Person o) {
        return ComparisonChain.start().compare(this.firstName, o.firstName)
                .compare(this.secondName, o.secondName).result();
    }
}
